package com.loren.tetris.windows.ui;

import com.loren.tetris.data.GameData;
import com.loren.tetris.data.constant.DataConstant;
import com.loren.tetris.utils.AssistiveUtils;

import java.awt.*;

public class BoxExplain extends Box {

    public BoxExplain(int boxX, int boxY, int boxW, int boxH, GameData gameData) {
        super(boxX, boxY, boxW, boxH, gameData);
    }

    @Override
    protected void gameAction(Graphics g) {
        Graphics2D g2d = (Graphics2D) g;
        this.drawBoxTitle(g2d, "操作说明");

        g2d.setColor(DataConstant.COLOR_WHITE);
        g2d.setFont(new Font(AssistiveUtils.getFontFamily(), Font.BOLD, 18));
        g2d.drawString("旋转：↑", this.getBoxX() + 30, this.getBoxY() + 63);
        g2d.drawString("向下：↓", this.getBoxX() + 30, this.getBoxY() + 98);
        g2d.drawString("向左：←", this.getBoxX() + 30, this.getBoxY() + 133);
        g2d.drawString("向右：→", this.getBoxX() + 30, this.getBoxY() + 168);
        g2d.drawString("速落：Ctrl", this.getBoxX() + 30, this.getBoxY() + 203);
        g2d.drawString("阴影：Space", this.getBoxX() + 30, this.getBoxY() + 238);
        g2d.drawString("暂停：Enter", this.getBoxX() + 30, this.getBoxY() + 273);
    }
}
